import { lazy } from "react";
import { createBrowserRouter } from "react-router-dom";

const Home=lazy(()=>import('../Page/Home'))
const Chat=lazy(()=>import('../Page/Chat'))
const MainLayout=lazy(()=>import('../Page/MainLayout'))
const Login=lazy(()=>import('../Page/Login'))
const Detail=lazy(()=>import('../Page/Detail'))
const List=lazy(()=>import('../Page/List'))
const City=lazy(()=>import('../Page/City'))
const NoFound=lazy(()=>import('../Page/NoFound'))

export const routes=createBrowserRouter([
    {
        path:'/',
        element:<MainLayout/>,
        children:[
            {
                path:'/',
                element:<Home/>
            },
            {
                path:'/chat',
                element:<Chat/>
            },
           
            {
                path:'/list',
                element:<List/>
            },
        ]
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/detail/:id',
        element:<Detail/>
    },
    {
        path:'/city',
        element:<City/>
    },
    {
        path:'*',
        element:<NoFound/>
    }
])